<%#include "menu.h" %>
<%
QString lang = httpRequest().cookie("lang");
QVariantMap qMap = httpRequest().queryItems();
QString tid = tId();

QString action = qMap.contains("action") ? httpRequest().queryItemValue("action"): variant("action").toString();
QString menuId = qMap.contains("menuId") ? httpRequest().queryItemValue("menuId"): variant("menuId").toString();
Menu menu = Menu::get(hmacVal(menuId).toInt());

QVariantMap qMapOut;
qMapOut.insert("menuId",menuId);
qMapOut.insert("action",action);
%>
<% if (action == "show"){ %>
<!-- show -->
<div id="formMenu<%== tid %>" name="formMenu" class="form" >
  <table class="layout-fixed" width="100%">
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUCD") %>:</td>
      <td><span style="padding-right:30px;" ><%== menu.menuCd() %></span>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUNAMEZH") %>:</td>
      <td><span style="padding-right:30px;" ><%== menu.menuNameZh() %></span>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUNAMEEN") %>:</td>
      <td><span style="padding-right:30px;" ><%== menu.menuNameEn() %></span>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUTOOLTIP") %>:</td>
      <td colspan="5"><span style="padding-right:15px;"><%== menu.menuTooltip() %></span></td>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUDESC") %>:</td>
      <td colspan="5"><span style="padding-right:15px;"><%== menu.menuDesc() %></span></td>
   </tr>
  </table>
</div>
<% }else { %>
<!-- edit -->
<div id="formMenu<%== tid %>" name="formMenu" class="form" action="/SystemUIsetting/<%== action %>Menu">
  <%== inputAuthenticityTag() %>
  <% if (action != "create") { %>
     <input name="menuId" class="mini-textbox" visible="false" value="<%== menuId %>"  /> 
  <% } %>
  <table style="width:100%">
   <tr>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("MENUCD") %></b>:</td>
      <td><input name="menuCd" class="mini-textbox" vtype="maxLength:64" style="width:100%" value="<%== menu.menuCd() %>" /></td>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("MENUNAMEZH") %></b>:</td>
      <td><input name="menuNameZh" class="mini-textbox" vtype="maxLength:64" style="width:100%" value="<%== menu.menuNameZh() %>" /></td>
      <td style="text-align:right;white-space:nowrap"><b><%== UI("MENUNAMEEN") %></b>:</td>
      <td><input name="menuNameEn" class="mini-textbox" vtype="maxLength:64" style="width:100%" value="<%== menu.menuNameEn() %>" /></td>
   </tr>
   <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUTOOLTIP") %>:</td>
      <td colspan="5"><input name="menuTooltip" class="mini-textarea" vtype="maxLength:256" style="width:100%" value="<%== menu.menuTooltip() %>" /></td>
    </tr>
    <tr>
      <td style="text-align:right;white-space:nowrap"><%== UI("MENUDESC") %>:</td>
      <td colspan="5"><input name="menuDesc" class="mini-textarea" style="width:100%" value="<%== menu.menuDesc() %>" /></td>
    </tr>
  </table>
</div>
<% } %>
<!-- toolBar -->
<div class="mini-toolbar" style="border:0px">
</div>
<!-- tabs -->
<div class="mini-fit">
    <% if (action != "create") { %>
    <%== renderPartial("SystemUIsetting/relationOfMenu",qMapOut) %> 
    <% } %>
</div>